#!/bin/bash

if [ $UID -ne 0 ]
then
    printf "\e[35mPlease run as root\e[0m\n"
    exit 1
fi

PISCES_ROOT="/bin"
TARGET="pisces"
PISCES_CONF_ROOT="/etc/pisces"
PISCES_LOG_ROOT="/var/log/pisces"

if [ -d $PISCES_CONF_ROOT ]
then
    cp pisces.conf pisces.mime $PISCES_CONF_ROOT
else
    mkdir $PISCES_CONF_ROOT
    cp pisces.conf pisces.mime $PISCES_CONF_ROOT
fi

rm -rf $PISCES_LOG_ROOT 2>/dev/null
mkdir $PISCES_LOG_ROOT

rm $PISCES_ROOT/$TARGET 2>/dev/null
mv pisces $PISCES_ROOT/$TARGET

printf "\e[36m----------Done!----------\e[0m\n"
